<?php
if (isset($_SESSION["email"])) {

    $createAccountComplete = 29.5;
    $requiredFiledComplete = 3.5;
    $otherFieldComplete = 3;

    $progress = 0 + $createAccountComplete;

    if (strlen($user->getWebsite()) > 0) {
        $progress += $otherFieldComplete;
    }
    if (strlen($user->getProfileEmail()) > 0) {
        $progress += $requiredFiledComplete;
    }
    if (strlen($user->getCellphone()) > 0) {
        $progress += $otherFieldComplete;
    }
    if (strlen($user->getTelephone()) > 0) {
        $progress += $requiredFiledComplete;
    }
    if ($user->getMailingZipCode() > 0) {
        $progress += $requiredFiledComplete;
    }
    if ($user->getMailingStateId() > 0) {
        $progress += $requiredFiledComplete;
    }
    if (strlen($user->getMailingCity()) > 0) {
        $progress += $requiredFiledComplete;
    }
    if (strlen($user->getMailingAddress()) > 0) {
        $progress += $requiredFiledComplete;
    }
    if ($user->getPhysicalZipCode() > 0) {
        $progress += $otherFieldComplete;
    }
    if ($user->getPhysicalStateId() > 0) {
        $progress += $otherFieldComplete;
    }
    if (strlen($user->getPhysicalCity()) > 0) {
        $progress += $otherFieldComplete;
    }
    if (strlen($user->getPhysicalAddress()) > 0) {
        $progress += $otherFieldComplete;
    }
    if (strlen($user->getCompanyName()) > 0) {
        $progress += $requiredFiledComplete;
    }
    if (strlen($user->getProfileLastName()) > 0) {
        $progress += $requiredFiledComplete;
    }
    if (strlen($user->getProfileFirstName()) > 0) {
        $progress += $requiredFiledComplete;
    }
    if (count($user->getServices()) > 0) {
        $progress += $requiredFiledComplete;
    }
    if (($user->getK12ClienteleIndicator() == "1") || ($user->getHigherEducationClienteleIndicator() == "1")) {
        $progress += $requiredFiledComplete;
    }
    if (strlen($user->getBackgroundDescription()) > 0) {
        $progress += $requiredFiledComplete;
    }
    if (strlen($user->getEducationDescription()) > 0) {
        $progress += $requiredFiledComplete;
    }
    if (strlen($user->getExperienceDescription()) > 0) {
        $progress += $requiredFiledComplete;
    }
    if (($user->getComplaintIndicator() == "1") || ($user->getPendingLitigationIndicator() == "1") || ($user->getNoneIndicator() == "1")) {
        $progress += $requiredFiledComplete;
    }
?>
<script>

    logoutButtonImage_on = new Image ( );
    logoutButtonImage_off = new Image ( );

    logoutButtonImage_on.src = "images/buttons/logoutIn.png";
    logoutButtonImage_off.src = "images/buttons/logoutOut.png";

</script>

<div style="font-family:Verdana;font-size:12px;">
    <div id="leftMenu">
        <div id ="leftMenu1"
             <?php
             if ($isAccountHome) {
             ?>
                class="current"
             <?php    
             } else {
             ?>
                onclick="goTo('userAccountHome.php');"
                onmouseover="activateLeftMenuButton('leftMenu1')"
                onmouseout="deactivateLeftMenuButton('leftMenu1')"
             <?php
             }
             ?>
        >
            Home
        </div>
        <div id ="leftMenu2"
             <?php
             if ($isProfilePage) {
             ?>
                class="current"
             <?php
             } else {
             ?>
                onclick="goTo('userManageProfile.php');"
                onmouseover="activateLeftMenuButton('leftMenu2')"
                onmouseout="deactivateLeftMenuButton('leftMenu2')"
             <?php
             }
             ?>
        >
            Manage Public Profile
        </div>
        <div id ="leftMenu3"
             <?php
             if ($isAccountPage) {
             ?>
                class="current"
             <?php
             } else {
             ?>
                onclick="goTo('userManageAccount.php');"
                onmouseover="activateLeftMenuButton('leftMenu3')"
                onmouseout="deactivateLeftMenuButton('leftMenu3')"
             <?php
             }
             ?>
        >
            Edit Account Settings
        </div>
        <div id ="leftMenu4"
             <?php
             if ($isSearchConsultantPage) {
             ?>
                class="current"
             <?php
             } else {
             ?>
                onclick="goTo('searchConsultant.php');"
                onmouseover="activateLeftMenuButton('leftMenu4')"
                onmouseout="deactivateLeftMenuButton('leftMenu4')"
             <?php
             }
             ?>
        >
            Search Public Registry
        </div>
    </div>
    <div style="padding:0px 10px 20px 0px;">
        <a href="index.php">
            <img src="images/buttons/logoutOut.png"
                 id="logoutButtonImage"
                 name="logoutButtonImage"
                 onmouseover="button_on('logoutButtonImage');"
                 onmouseout="button_off('logoutButtonImage');"
                 style="border:0px;"
                 alt="logoutIn"/>
        </a>
    </div>
    <div id="userInformationLeftBarArea"
         style="z-index:1;position:relative;">
        <div style="width:175px;height:175px;border:1px solid #AAAAAA;margin-bottom:20px;margin-top:0px;">
            <div style="font-weight:bold;padding:5px 0px 5px 0px;background-color:#AAAAAA;color:#FFFFFF;text-align:center;">
                Account Activity
            </div>
            <div style="padding:10px 0px 0px 10px;">
                <div style="font-weight:bold;padding:0px 0px 5px 0px;">
                    Last Saved Profile:
                </div>
                <div id="lastSaveProfileLeftAreaMessage" style="font-weight:normal;padding:0px 0px 0px 0px;">
                    <?php echo ($user->getProfileLastModificationDate() != "") ? date("m/d/Y \a\\t g:i A", strtotime($user->getProfileLastModificationDate())) : "Not Available" ; ?>
                </div>
            </div>
            <div style="padding:10px 0px 0px 10px;">
                <div style="font-weight:bold;padding:0px 0px 5px 0px;">
                    Last Submitted Profile:
                </div>
                <div id="lastSubmitProfileLeftAreaMessage" style="font-weight:normal;padding:0px 0px 0px 0px;">
                    <?php echo (($user->getProfileLastSubmissionDate() != "") && ($user->getProfileSubmittedIndicator() == "1")) ? date("m/d/Y \a\\t g:i A", strtotime($user->getProfileLastSubmissionDate())) : "Not Available"; ?>
                </div>
            </div>
            <div style="padding:10px 0px 0px 10px;">
                <div style="font-weight:bold;padding:0px 0px 5px 0px;">
                    Date of Removal:
                </div>
                <div id="dateOfRemovalLeftAreaMessage" style="font-weight:normal;padding:0px 0px 0px 0px;">
                    <?php echo (($user->getProfileLastSubmissionDate() != "") && ($user->getProfileSubmittedIndicator() == "1")) ? date("m/d/Y \a\\t g:i A", strtotime('+2 years', strtotime($user->getProfileLastSubmissionDate()))) : "Not Available"; ?>
                </div>
            </div>
        </div>
        <div style="width:175px;height:125px;border:1px solid #AAAAAA;margin-top:0px;">
            <div style="font-weight:bold;padding:5px 0px 5px 0px;background-color:#AAAAAA;color:#FFFFFF;text-align:center;">
                Profile Status
            </div>
            <div style="padding:10px 0px 0px 10px;">
                <div dojoType="dijit.ProgressBar"
                 style="width:150px;"
                 jsId="userAccountProgress"
                 id="userAccountProgress"
                 progress="<?php echo $progress; ?>"></div>
            </div>
            <div style="padding:10px 0px 0px 10px;"
                 id="isProfileAvailableQuesiton">
                Profile is currently available on the public registry?
                <?php echo ($user->getProfileSubmittedIndicator() == "1") ? '<span style="color:green;font-weight:bold;">YES</span>' : '<span style="color:red;font-weight:bold;">NO</span>' ; ?>
            </div>
        </div>
    </div>
</div>
<?php
} else {
?>
    <div id="leftMenu">
        <div id ="leftMenu1"
             <?php
             if ($isAccountHome) {
             ?>
                class="current"
             <?php
             } else {
             ?>
                onclick="goTo('index.php');"
                onmouseover="activateLeftMenuButton('leftMenu1')"
                onmouseout="deactivateLeftMenuButton('leftMenu1')"
             <?php
             }
             ?>
        >
            Close Public Search
        </div>
    </div>
<?php
}
?>
